package com.ruoyi.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.domain.BasisUavTable;
import com.ruoyi.dto.BasisLoadingUavCamp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.BasisUavMapper;
import com.ruoyi.domain.BasisUav;
import com.ruoyi.service.IBasisUavService;

/**
 * 无人机Service业务层处理
 * 
 * @author wangzebing
 * @date 2025-05-24
 */
@Service
public class BasisUavServiceImpl implements IBasisUavService 
{
    @Autowired
    private BasisUavMapper basisUavMapper;

    /**
     * 查询无人机
     * 
     * @param uavId 无人机主键
     * @return 无人机
     */
    @Override
    public BasisUav selectBasisUavByUavId(Long uavId)
    {
        return basisUavMapper.selectBasisUavByUavId(uavId);
    }

    /**
     * 查询无人机列表
     * 
     * @param basisUav 无人机
     * @return 无人机
     */
    @Override
    public List<BasisUav> selectBasisUavList(BasisUav basisUav)
    {
        return basisUavMapper.selectBasisUavList(basisUav);
    }

    /**
     * 新增无人机
     * 
     * @param basisUav 无人机
     * @return 结果
     */
    @Override
    public int insertBasisUav(BasisUav basisUav)
    {
        return basisUavMapper.insertBasisUav(basisUav);
    }

    /**
     * 修改无人机
     * 
     * @param basisUav 无人机
     * @return 结果
     */
    @Override
    public int updateBasisUav(BasisUav basisUav)
    {
        return basisUavMapper.updateBasisUav(basisUav);
    }

    /**
     * 批量删除无人机
     * 
     * @param uavIds 需要删除的无人机主键
     * @return 结果
     */
    @Override
    public int deleteBasisUavByUavIds(Long[] uavIds)
    {
        return basisUavMapper.deleteBasisUavByUavIds(uavIds);
    }

    /**
     * 删除无人机信息
     * 
     * @param uavId 无人机主键
     * @return 结果
     */
    @Override
    public int deleteBasisUavByUavId(Long uavId)
    {
        return basisUavMapper.deleteBasisUavByUavId(uavId);
    }

    @Override
    public boolean addBasisLoadingUavCamp(BasisLoadingUavCamp basisLoadingUavCamp) {

        boolean b = basisUavMapper.addBasisLoadingUavCampDt(basisLoadingUavCamp);

        return basisUavMapper.addBasisLoadingUavCamp(basisLoadingUavCamp);
    }

    @Override
    public boolean updateBasisLoadingUavCamp(BasisLoadingUavCamp basisLoadingUavCamp) {

        boolean b = basisUavMapper.updateBasisLoadingUavCamp(basisLoadingUavCamp);

        if(b){
            basisUavMapper.updateBasisLoadingUavCampDt(basisLoadingUavCamp);
        }
        return b;
    }

    @Override
    public boolean updateBasisLoadingUavCampDt(BasisLoadingUavCamp basisLoadingUavCamp) {
        return basisUavMapper.updateBasisLoadingUavCampDt(basisLoadingUavCamp);
    }

    @Override
    public boolean delBasisLoadingUavCamp(String loadingId, Integer uavId) {
        return basisUavMapper.delBasisLoadingUavCamp(loadingId, uavId);
    }

    @Override
    public Map<String, Object> fidnByBasisLoadingUavCamp(String loadingId, Integer uavId) {
        return basisUavMapper.fidnByBasisLoadingUavCamp(loadingId, uavId);
    }

    @Override
    public Map<String, Object> fidnByBasisLoadingUavCampDT(String loadingId, Integer uavId) {
        return basisUavMapper.fidnByBasisLoadingUavCampDT(loadingId, uavId);
    }

    //根据案例和阵营查询无人机
    @Override
    public List<BasisLoadingUavCamp> findByLoadingIdAndCampId(String loadingId, Integer campId,Integer positionId) {
        return basisUavMapper.findByLoadingIdAndCampId(loadingId, campId,positionId);
    }

    //根据案例和阵营查询无人机
    @Override
    public List<BasisLoadingUavCamp> findByLoadingIdAndCampId2(String loadingId, Integer campId) {
        return basisUavMapper.findByLoadingIdAndCampId2(loadingId, campId);
    }

    @Override
    public List<BasisUav> selectBasisUavLoading(String loadingId) {
        return basisUavMapper.selectBasisUavLoading(loadingId);
    }

    @Override
    public List<BasisUav> selectBasisUavLoadingDT(String loadingId) {
        return basisUavMapper.selectBasisUavLoadingDT(loadingId);
    }

    @Override
    public List<BasisLoadingUavCamp> findByLoadingIdAndCampIdDT(String loadingId, Integer campId,Integer positionId) {
        return basisUavMapper.findByLoadingIdAndCampIdDT(loadingId, campId,positionId);
    }




}
